import request from '@/utils/request'

export function list(data) {
  return request({
    url: '/system/dept/list',
    method: 'post',
    data: data
  })
}
export function treeselect() {
  return request({
    url: '/system/dept/treeselect',
    method: 'get'
  })
}
export function listByPage(data) {
  return request({
    url: '/system/dept/listByPage',
    method: 'post',
    data: data
  })
}
export function all(data) {
  return request({
    url: '/system/dept/all',
    method: 'post',
    data: data
  })
}
export function allExcludeChildren(data) {
  return request({
    url: '/system/dept/allExcludeChildren',
    method: 'post',
    data: data
  })
}

// export function add(data) {
//   return request({
//     url: '/system/dept/add',
//     method: 'post',
//     data: data
//   })
// }
// export function edit(data) {
//   return request({
//     url: '/system/dept/edit',
//     method: 'post',
//     data: data
//   })
// }
export function remove(data) {
  return request({
    url: '/system/dept/delete',
    method: 'post',
    data: data
  })
}
export function selectUserByDeptId(data) {
  return request({
    url: '/system/dept/selectUserByDeptId',
    method: 'post',
    data: data
  })
}
export function userList(data) {
  return request({
    url: '/system/user/list',
    method: 'post',
    data: data
  })
}
export function getInfo(data) {
  return request({
    url: '/system/dept/' + data,
    method: 'get'
  })
}
// 新增部门
export function add(data) {
  return request({
    url: '/system/dept',
    method: 'post',
    data: data
  })
}

// 修改部门
export function edit(data) {
  return request({
    url: '/system/dept',
    method: 'put',
    data: data
  })
}
// 删除部门
export function delDept(deptId) {
  return request({
    url: '/system/dept/' + deptId,
    method: 'delete'
  })
}
